const UPDATE_ROUTE = (state, payload) => {
    state.flat_route = [...payload];
}

const INSERT_ROUTE = (state, payload) => {
    state.flat_route.push(payload);
}

const REMOVE_ROUTE = (state, payload) => {
    state.flat_route.forEach((item, index) => {
        if (item.route_id === payload) {
            state.flat_route.splice(index, 1);
        }
    });
}

export default {
    UPDATE_ROUTE,
    INSERT_ROUTE,
    REMOVE_ROUTE
}